{
	"info": {
		"_postman_id": "50bb3679-defa-4d22-88cd-7d47b93a3a3e",
		"name": "coreapi-v09",
		"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json",
		"_exporter_id": "15836409"
	},
	"item": [
		{
			"name": "01-register",
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "name",
							"value": "Bart Allen",
							"type": "text"
						},
						{
							"key": "email",
							"value": "bart.allen@starlabs.com",
							"type": "text"
						},
						{
							"key": "password",
							"value": "iamimpulse",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{base_url}}/register?locale={{locale}}",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"register"
					],
					"query": [
						{
							"key": "locale",
							"value": "{{locale}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "06-create-one",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"const responseJson = pm.response.json();",
							"pm.collectionVariables.set(\"idToRead\", responseJson.resource.id);",
							"pm.collectionVariables.set(\"idToUpdate\", responseJson.resource.id);",
							"pm.collectionVariables.set(\"idToDelete\", responseJson.resource.id);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{coreapi_token}}",
							"type": "string"
						}
					]
				},
				"method": "POST",
				"header": [],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "name",
							"value": "Joe West",
							"type": "text"
						},
						{
							"key": "email",
							"value": "joe.west@ccpd.com",
							"type": "text"
						},
						{
							"key": "password",
							"value": "iamflashfather",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{base_url}}/{{endpoint}}?locale={{locale}}",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"{{endpoint}}"
					],
					"query": [
						{
							"key": "locale",
							"value": "{{locale}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "02-login",
			"event": [
				{
					"listen": "test",
					"script": {
						"exec": [
							"const responseJson = pm.response.json();",
							"pm.collectionVariables.set(\"coreapi_token\", responseJson.coreapi_token);"
						],
						"type": "text/javascript"
					}
				}
			],
			"request": {
				"method": "POST",
				"header": [],
				"body": {
					"mode": "formdata",
					"formdata": [
						{
							"key": "email",
							"value": "bart.allen@starlabs.com",
							"type": "text"
						},
						{
							"key": "password",
							"value": "iamimpulse",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{base_url}}/login?locale={{locale}}",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"login"
					],
					"query": [
						{
							"key": "locale",
							"value": "{{locale}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "10-logout",
			"protocolProfileBehavior": {
				"disableBodyPruning": true
			},
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{coreapi_token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"body": {
					"mode": "formdata",
					"formdata": []
				},
				"url": {
					"raw": "{{base_url}}/logout?locale={{locale}}",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"logout"
					],
					"query": [
						{
							"key": "locale",
							"value": "{{locale}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "04-authenticated-user",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{coreapi_token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{base_url}}/authenticatedUser?locale={{locale}}",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"authenticatedUser"
					],
					"query": [
						{
							"key": "locale",
							"value": "{{locale}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "05-read-all",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{coreapi_token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{base_url}}/{{endpoint}}?locale={{locale}}",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"{{endpoint}}"
					],
					"query": [
						{
							"key": "locale",
							"value": "{{locale}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "09-delete-one",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{coreapi_token}}",
							"type": "string"
						}
					]
				},
				"method": "DELETE",
				"header": [],
				"url": {
					"raw": "{{base_url}}/{{endpoint}}/{{idToDelete}}?locale={{locale}}",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"{{endpoint}}",
						"{{idToDelete}}"
					],
					"query": [
						{
							"key": "locale",
							"value": "{{locale}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "08-update-one",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{coreapi_token}}",
							"type": "string"
						}
					]
				},
				"method": "PUT",
				"header": [],
				"body": {
					"mode": "urlencoded",
					"urlencoded": [
						{
							"key": "name",
							"value": "Name Updated",
							"type": "text"
						}
					]
				},
				"url": {
					"raw": "{{base_url}}/{{endpoint}}/{{idToUpdate}}?locale={{locale}}",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"{{endpoint}}",
						"{{idToUpdate}}"
					],
					"query": [
						{
							"key": "locale",
							"value": "{{locale}}"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "07-read-one",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{coreapi_token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{base_url}}/{{endpoint}}/{{idToRead}}?locale={{locale}}&include[]=role",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"{{endpoint}}",
						"{{idToRead}}"
					],
					"query": [
						{
							"key": "locale",
							"value": "{{locale}}"
						},
						{
							"key": "include[]",
							"value": "role"
						}
					]
				}
			},
			"response": []
		},
		{
			"name": "03-activate",
			"request": {
				"auth": {
					"type": "bearer",
					"bearer": [
						{
							"key": "token",
							"value": "{{coreapi_token}}",
							"type": "string"
						}
					]
				},
				"method": "GET",
				"header": [],
				"url": {
					"raw": "{{base_url}}/activate?locale={{locale}}&email=bart.allen@starlabs.com",
					"host": [
						"{{base_url}}"
					],
					"path": [
						"activate"
					],
					"query": [
						{
							"key": "locale",
							"value": "{{locale}}"
						},
						{
							"key": "email",
							"value": "bart.allen@starlabs.com"
						}
					]
				}
			},
			"response": []
		}
	],
	"event": [
		{
			"listen": "prerequest",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		},
		{
			"listen": "test",
			"script": {
				"type": "text/javascript",
				"exec": [
					""
				]
			}
		}
	],
	"variable": [
		{
			"key": "base_url",
			"value": "http://coreapi.test:81/api/v1",
			"type": "string"
		},
		{
			"key": "coreapi_token",
			"value": ""
		},
		{
			"key": "endpoint",
			"value": "users",
			"type": "string"
		},
		{
			"key": "idToRead",
			"value": "",
			"type": "string"
		},
		{
			"key": "idToUpdate",
			"value": "",
			"type": "string"
		},
		{
			"key": "idToDelete",
			"value": "",
			"type": "string"
		},
		{
			"key": "locale",
			"value": "en_US",
			"type": "string"
		}
	]
}